﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GroupMenu.aspx.cs" Inherits="CRS.Web.BackStageManagement.GroupMenu" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
    <meta http-equiv="Expires" content="0">
    <title></title>

    <script type="text/javascript">
        // 点击复选框时触发事件
        function postBackByObject() {
            var o = window.event.srcElement;
            if (o.tagName == "INPUT" && o.type == "checkbox") {
                __doPostBack("", "");
            }
        }
    </script>
    
    <script type="text/javascript">
        function CheckEvent(evt) {
            evt = window.event || evt;
            var objNode = evt.srcElement || evt.target;
            if (objNode.tagName == "INPUT" && objNode.type == "checkbox") {
                var objParentDiv = objNode.id.replace("CheckBox", "Nodes");
                if (objNode.checked == true) {
                    setChildCheckState(objParentDiv, true);
                    setParentCheckedState(objNode, true);
                }
                else {
                    setChildCheckState(objParentDiv, false);

                    if (!HasOtherChecked(objNode)) {
                        setParentCheckedState(objNode, false);
                    }
                }
            }
        }
        function HasOtherChecked(objNode) {
            var objParentDiv = WebForm_GetParentByTagName(objNode, "div");

            var chks = objParentDiv.getElementsByTagName("INPUT");
            for (var i = 0; i < chks.length; i++) {
                if (chks[i].checked && chks[i].id != objNode.id) {
                    return true;
                }
            }
            return false;
        }

        //设置父节点
        function setParentCheckedState(objNode, chkstate) {
            try {
                var objParentDiv = WebForm_GetParentByTagName(objNode, "div");

                if (objParentDiv == null || objParentDiv == "undefined ") {
                    return;
                }
                else {
                    var objParentChkId = objParentDiv.id.replace("Nodes", "CheckBox");
                    var objParentCheckBox = document.getElementById(objParentChkId);

                    if (objParentCheckBox) {
                        if (chkstate == true) {
                            objParentCheckBox.checked = chkstate;
                            setParentCheckedState(objParentDiv, chkstate);
                        }
                        
                    }
                }
            }
            catch (e) { }
        }

        //设置子节点
        function setChildCheckState(nodeid, chkstate) {
            var node = document.getElementById(nodeid);

            if (node) {
                var chks = node.getElementsByTagName("INPUT");
                for (var i = 0; i < chks.length; i++) {
                    chks[i].checked = chkstate;
                }
            }
        } 

    </script>

    <link href="../ScriptFiles/CSS/Main.css" type="text/css" rel="stylesheet" />
    <link href="../App_Themes/Default/Body.css" type="text/css" rel="stylesheet" />
    <link href="../App_Themes/Default/Img.css" type="text/css" rel="stylesheet" />
    <link href="../App_Themes/Default/Menu.css" type="text/css" rel="stylesheet" />
    <link href="../App_Themes/Default/subModal.css" type="text/css" rel="stylesheet" />
    <link href="../App_Themes/Default/Table.css" type="text/css" rel="stylesheet" />
    <link href="../App_Themes/Default/Text.css" type="text/css" rel="stylesheet" />
    <base target="_self" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
         
                
                 <table style="border: 1px solid #A8CFEB; background-color: #F1F6FF; margin-top: 4px;">
                    <tr align="center">
                        <td>
                            <asp:Button ID="btnSubimt" runat="server" Text="提交" OnClick="btn_Submit_Click" class="btn_mouseout"
                                onmouseover="this.className= 'btn_mouseover ' " onmouseout="this.className= 'btn_mouseout ' "
                                onmousedown="this.className= 'btn_mousedown '" onmouseup="this.className= 'btn_mouseup '" />
                            <asp:Button ID="btnCancel" runat="server" Text="关闭" OnClick="Button_Cancel_Click"
                                class="btn_mouseout" onmouseover="this.className= 'btn_mouseover ' " onmouseout="this.className= 'btn_mouseout ' "
                                onmousedown="this.className= 'btn_mousedown '" onmouseup="this.className= 'btn_mouseup '" />
                        </td>
                    </tr>
                    </table>
                    <asp:Label ID="labelRoleId" runat="server" Visible="false"></asp:Label>
                     <table>
                    <tr>
                        <td class="tableBg2" style="text-align: left; width: auto">
                            <asp:TreeView ID="TreeView_Menu" ShowLines="True" runat="server" ExpandDepth="0"
                                LineImagesFolder="Images/TreeLineImages" Style="margin-top: 0px; margin-left: 0px"
                                Width="10px" ShowCheckBoxes="All" >
                            </asp:TreeView>
                        </td>
                    </tr>
                </table>
            </div>
     
    </form>
</body>
</html>
